Create First .NET Core application in Raspberry Pi with examples

Raspberry Pi in NET Core with examples

In our previous articles Setting up Raspberry Pi – Step by step and Build .NET Core IoT App on Raspberry Pi we learned how to get started with Raspberry Pi and install the setup for .NET Core. In today’s article, we shall continue our journey and will learn how to use Raspberry Pi in .NET Core and create a simple “Hello World” application.

Today in this article, we will cover below aspects,

Prerequisites:

Create “Hello World” application

Remember since we have .NET Core SDK installed, we can now create a .NET Core app right within Raspberry Pi.

Let quickly check the .NET Core version on Pi,

 dotnet --info

Please note that you might go out of space soon using Raspberry Pi. The easy approach would be to create, build, and compile the project on your LaptopDesktop and then copy it over to Pi. Once copied binaries can be executed on Raspberry Pi.

Let’s create a console application using the below command in a Raspberry Pi terminal window.

dontet new console

Above command shall add .csproj file and Program.cs file.

Add “Hello World” to the Main() method. and That’s all.

Let’s run our first .NET Core app using the below command,

dotnet run [app-path]

You shall see below on the terminal window.

blank

That’s all! Enjoy coding!

Useful references :

Do you have any comments or ideas or any better suggestions to share?

Please sound off your comments below.

Happy Coding !!



Please bookmark this page and share it with your friends. Please Subscribe to the blog to receive notifications on freshly published(2024) best practices and guidelines for software design and development.



2 thoughts on “Raspberry Pi in .NET Core with examples

  1. Thanks . I tried to follow the mentioned steps but got error – Unable to locate libunwind. Install libunwind to continue. Any idea if I m doing anything different.

Leave a Reply

Your email address will not be published. Required fields are marked *